package com.relanet.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.opensymphony.xwork2.ActionSupport;

public class BaseAction extends ActionSupport {

	public final static String NOLOGIN = "nologin";

	private String infoMessage;

	private int status;

	public String getInfoMessage() {
		return infoMessage;
	}

	public void setInfoMessage(String infoMessage) {
		this.infoMessage = infoMessage;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	/**
	 * 
	 */
	public BaseAction() {

	}

	public HttpServletRequest getRequest() {
		return org.apache.struts2.ServletActionContext.getRequest();
	}

	public HttpServletResponse getResponse() {
		return org.apache.struts2.ServletActionContext.getResponse();
	}

	protected boolean setParameter(String name, Object value) {
		if (name == null || name.trim().length() <= 0 || value == null)
			return false;
		getRequest().setAttribute(name, value);
		return true;
	}
}
